﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Noodles.Core.Model;
using Noodles.Core.Repositories;

namespace NoodlesCms.Controllers
{
    public class CommentsController : Controller
    {
        //
        // GET: /Comments/
        public INoodlesRepository commentsRepo { get; set; }
        public IRepository Irepo { get; set; }
        
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public JsonResult Create(Comments commentData)
        {
            commentData.CreateDate = DateTime.Now;
            commentData.UpdateDate = DateTime.Now;
            Irepo.Add(commentData);
            return Json("Comments Added Successfully !");
        }

    }
}
